#include<iostream>
#include <memory>
#include "tcp_server.hpp"

using namespace std;
using namespace ns_server;

void Usage(const char* proc)
{
    cout << "Usage:" << endl;
    cout << "\t" << proc << " port" << endl;
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        return USER_ERR;
    }

    int port = stoi(argv[1]);

    unique_ptr<TcpServer> tcit(new TcpServer(port));

    tcit->InitServer();
    tcit->StartServer();

    return 0;
}